package com.ruoyi.rural.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rural.domain.RuralApplicationBenefitAnagement;
import com.ruoyi.rural.mapper.RuralApplicationBenefitAnagementMapper;
import com.ruoyi.rural.service.IRuralApplicationBenefitAnagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * 救济金申领Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-06
 */
@Service
public class RuralApplicationBenefitAnagementServiceImpl implements IRuralApplicationBenefitAnagementService 
{
    @Autowired
    private RuralApplicationBenefitAnagementMapper ruralApplicationBenefitAnagementMapper;

    /**
     * 查询救济金申领
     * 
     * @param id 救济金申领主键
     * @return 救济金申领
     */
    @Override
    public RuralApplicationBenefitAnagement selectRuralApplicationBenefitAnagementById(String id)
    {
        return ruralApplicationBenefitAnagementMapper.selectRuralApplicationBenefitAnagementById(id);
    }

    /**
     * 查询救济金申领列表
     * 
     * @param ruralApplicationBenefitAnagement 救济金申领
     * @return 救济金申领
     */
    @Override
    public List<RuralApplicationBenefitAnagement> selectRuralApplicationBenefitAnagementList(RuralApplicationBenefitAnagement ruralApplicationBenefitAnagement)
    {
        return ruralApplicationBenefitAnagementMapper.selectRuralApplicationBenefitAnagementList(ruralApplicationBenefitAnagement);
    }

    /**
     * 新增救济金申领
     * 
     * @param ruralApplicationBenefitAnagement 救济金申领
     * @return 结果
     */
    @Override
    public int insertRuralApplicationBenefitAnagement(RuralApplicationBenefitAnagement ruralApplicationBenefitAnagement)
    {
        ruralApplicationBenefitAnagement.setId(UUID.randomUUID().toString());
        ruralApplicationBenefitAnagement.setCreateTime(DateUtils.getNowDate());
        return ruralApplicationBenefitAnagementMapper.insertRuralApplicationBenefitAnagement(ruralApplicationBenefitAnagement);
    }

    /**
     * 修改救济金申领
     * 
     * @param ruralApplicationBenefitAnagement 救济金申领
     * @return 结果
     */
    @Override
    public int updateRuralApplicationBenefitAnagement(RuralApplicationBenefitAnagement ruralApplicationBenefitAnagement)
    {
        ruralApplicationBenefitAnagement.setUpdateTime(DateUtils.getNowDate());
        return ruralApplicationBenefitAnagementMapper.updateRuralApplicationBenefitAnagement(ruralApplicationBenefitAnagement);
    }

    /**
     * 批量删除救济金申领
     * 
     * @param ids 需要删除的救济金申领主键
     * @return 结果
     */
    @Override
    public int deleteRuralApplicationBenefitAnagementByIds(String[] ids)
    {
        return ruralApplicationBenefitAnagementMapper.deleteRuralApplicationBenefitAnagementByIds(ids);
    }

    /**
     * 删除救济金申领信息
     * 
     * @param id 救济金申领主键
     * @return 结果
     */
    @Override
    public int deleteRuralApplicationBenefitAnagementById(String id)
    {
        return ruralApplicationBenefitAnagementMapper.deleteRuralApplicationBenefitAnagementById(id);
    }

    @Override
    public List<RuralApplicationBenefitAnagement> selectRuralApplicationBenefitAnagementListByWeek(RuralApplicationBenefitAnagement ruralApplicationBenefitAnagement) {
        return ruralApplicationBenefitAnagementMapper.selectRuralApplicationBenefitAnagementListByWeek(ruralApplicationBenefitAnagement);
    }
}
